<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PermissionRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
            'display_name' => 'required',
            'controller' => 'required',
            'actions' => 'required'
        ];
    }

    public function messages()
    {
        return [
            'display_name.required' => '菜单显示名称不能为空',
            'controller.required' => '权限控制器不能为空',
            'actions.required' => '权限方法名不能为空',
        ];
    }
}
